/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Johnny
 */
@Entity
@Table(catalog = "celulares", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Serie.findAll", query = "SELECT s FROM Serie s"),
    @NamedQuery(name = "Serie.findByIdserie", query = "SELECT s FROM Serie s WHERE s.idserie = :idserie"),
    @NamedQuery(name = "Serie.findByNumSerie", query = "SELECT s FROM Serie s WHERE s.numSerie = :numSerie"),
    @NamedQuery(name = "Serie.findByEstado", query = "SELECT s FROM Serie s WHERE s.estado = :estado")})
public class Serie
  implements Serializable
{
  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  @Basic(optional=false)
  @Column(nullable=false)
  private Integer idserie;

  @Column(length=20)
  private String numSerie;
  private Integer estado;

  @JoinColumn(name="idArticulo", referencedColumnName="codigo", nullable=false)
  @ManyToOne(optional=false)
  private Articulo idArticulo;

  public Serie()
  {
  }

  public Serie(Integer idserie)
  {
    this.idserie = idserie;
  }

  public Integer getIdserie() {
    return this.idserie;
  }

  public void setIdserie(Integer idserie) {
    this.idserie = idserie;
  }

  public String getNumSerie() {
    return this.numSerie;
  }

  public void setNumSerie(String numSerie) {
    this.numSerie = numSerie;
  }

  public Integer getEstado() {
    return this.estado;
  }

  public void setEstado(Integer estado) {
    this.estado = estado;
  }

  public Articulo getIdArticulo() {
    return this.idArticulo;
  }

  public void setIdArticulo(Articulo idArticulo) {
    this.idArticulo = idArticulo;
  }

  public int hashCode()
  {
    int hash = 0;
    hash += (this.idserie != null ? this.idserie.hashCode() : 0);
    return hash;
  }

  public boolean equals(Object object)
  {
    if (!(object instanceof Serie)) {
      return false;
    }
    Serie other = (Serie)object;
    if (((this.idserie == null) && (other.idserie != null)) || ((this.idserie != null) && (!this.idserie.equals(other.idserie)))) {
      return false;
    }
    return true;
  }

  public String toString()
  {
    return "com.mycompany.entidades.Serie[ idserie=" + this.idserie + " ]";
  }
}